package com.wjk.kylin.mall.product.entity.es;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author: wangjinkui
 * @Date: 2021/6/30
 * @Description : 商品 es bean
 */
@Data
@Accessors(chain = true)   // 链式赋值(连续set方法)
@AllArgsConstructor        // 全参构造
@NoArgsConstructor          // 无参构造
public class ProductESBean implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    private Long id;

    /**
     * productId
     */
    private Long productId;

    /**
     * 商品名称
     */
    private String productName;
    /**
     * 商品编码
     */
    private String productCode;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
//    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     *
     *{
     *   "mall_product" : {
     *     "aliases" : { },
     *     "mappings" : {
     *       "properties" : {
     *         "createTime" : {
     *           "type" : "long"
     *         },
     *         "id" : {
     *           "type" : "long"
     *         },
     *         "productCode" : {
     *           "type" : "text",
     *           "fields" : {
     *             "keyword" : {
     *               "type" : "keyword",
     *               "ignore_above" : 256
     *             }
     *           }
     *         },
     *         "productName" : {
     *           "type" : "text",
     *           "fields" : {
     *             "keyword" : {
     *               "type" : "keyword",
     *               "ignore_above" : 256
     *             }
     *           }
     *         },
     *         "updateTime" : {
     *           "type" : "text",
     *           "fields" : {
     *             "keyword" : {
     *               "type" : "keyword",
     *               "ignore_above" : 256
     *             }
     *           }
     *         }
     *       }
     *     },
     *     "settings" : {
     *       "index" : {
     *         "creation_date" : "1659179461653",
     *         "number_of_shards" : "1",
     *         "number_of_replicas" : "1",
     *         "uuid" : "1Fqt2zrNSqyVkt3V7gAprw",
     *         "version" : {
     *           "created" : "7060299"
     *         },
     *         "provided_name" : "mall_product"
     *       }
     *     }
     *   }
     * }
     *
     */
    /**
     * {
     *   "took" : 1,
     *   "timed_out" : false,
     *   "_shards" : {
     *     "total" : 1,
     *     "successful" : 1,
     *     "skipped" : 0,
     *     "failed" : 0
     *   },
     *   "hits" : {
     *     "total" : {
     *       "value" : 1,
     *       "relation" : "eq"
     *     },
     *     "max_score" : 1.0,
     *     "hits" : [
     *       {
     *         "_index" : "mall_product",
     *         "_type" : "_doc",
     *         "_id" : "1553337366896529410",
     *         "_score" : 1.0,
     *         "_source" : {
     *           "createTime" : 1659179462536,
     *           "id" : 1553337366896529410,
     *           "productCode" : "1001008",
     *           "productName" : "小米9",
     *           "updateTime" : "2022-07-30 19:11:02"
     *         }
     *       }
     *     ]
     *   }
     * }
     */
}
